package com.wuseguang.springcloud.dao.repository;

import com.wuseguang.springcloud.entity.Parent;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

public interface ParentRepository extends JpaRepository<Parent,Integer> {

    /**
     * 查询
     * @param phone
     * @return
     */
    @Query(value = "select id,phone,`password`,`name`,open_id_one,open_id_two,sex,DATE_FORMAT(due_date,'%Y-%m-%d') due_date from  parent where  phone = ?1",nativeQuery = true)
    Parent findByPhone(String phone);
}
